﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.Mvc;
using JinianNet.JNCms.Filters;
using System.Web;

namespace JinianNet.JNCms.Controllers
{
    public class ControllerTemplatePage : ControllerBase
    {
        public ControllerTemplatePage()
            : base()
        {
            Dictionary<string, object> site = new Dictionary<string, object>();
            site["Title"] = JinianNet.JNCms.Config.Site.Title;
            site["KeyWords"] = JinianNet.JNCms.Config.Site.KeyWords;
            site["Description"] = JinianNet.JNCms.Config.Site.Description;
            site["TemplateDirectory"] = JinianNet.JNCms.Config.Site.TemplateDirectory;
            site["SiteDirectory"] = JinianNet.JNCms.Config.Site.SiteDirectory;
            site["Theme"] = JinianNet.JNCms.Config.Site.Theme;
            site["Logo"] = JinianNet.JNCms.Config.Site.Logo;
            site["Host"] = JinianNet.JNCms.Config.Site.Host;
            site["Cookie"] = JinianNet.JNCms.Config.Site.Cookie;
            site["Name"] = JinianNet.JNCms.Config.Site.Name;
            site["Webmaster"] = JinianNet.JNCms.Config.Site.Webmaster;
            site["Email"] = JinianNet.JNCms.Config.Site.Email;
            site["Copyright"] = JinianNet.JNCms.Config.Site.Copyright;
            site["IsClose"] = JinianNet.JNCms.Config.Site.IsClose;
            site["TemplatePath"] = JinianNet.Common.Url.Concat(Config.Site.SiteDirectory, Config.Site.TemplateDirectory,  Config.Site.Theme);
            site["TemplateUrl"] = JinianNet.Common.Url.Concat("http://", Config.Site.Host, Config.Site.SiteDirectory, Config.Site.TemplateDirectory, Config.Site.Theme); 
            site["Url"] = JinianNet.Common.Url.Concat("http://", Config.Site.Host,Config.Site.SiteDirectory); 
            ViewData["Site"] = site;
        }
    }
}
